package com.supermap.agricultural_meteoro.monitor.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

@RestController
@RequestMapping
public class HomeController {

    @RequestMapping
    @ResponseBody
    public String home() {
        return "Home";
    }

    @RequestMapping(value = "post", method = RequestMethod.POST)
    @ResponseBody
    public JSONObject test(HttpServletRequest request, @RequestBody HashMap<String, String> data) {
        JSONObject result = new JSONObject();
        result.put("data", data);
        return result;
    }
}
